;; \
tbit.z p6,p0=r29,IA64_PSR_VM_BIT; \
;; \
- tbit.nz.or p6,p0 = r18,39; \
+ tbit.nz.or p6,p0 = r18,IA64_ISR_NI_BIT; \
;; \
-(p6) br.sptk.few vmx_panic; \
+(p6) br.spnt.few vmx_panic; \
tbit.z p0,p15=r29,IA64_PSR_I_BIT; \
mov r1=r16; \
/* mov r21=r16; */ \
return 0;
}
+#define COPY_FPREG(dst, src) memcpy(dst, src, sizeof(struct ia64_fpreg))
+
void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
{
int i;
c.nat->regs.ar.ccv = uregs->ar_ccv;
- c.nat->regs.f[6] = uregs->f6;
- c.nat->regs.f[7] = uregs->f7;
- c.nat->regs.f[8] = uregs->f8;
- c.nat->regs.f[9] = uregs->f9;
- c.nat->regs.f[10] = uregs->f10;
- c.nat->regs.f[11] = uregs->f11;
+ COPY_FPREG(&c.nat->regs.f[6], &uregs->f6);
+ COPY_FPREG(&c.nat->regs.f[7], &uregs->f7);
+ COPY_FPREG(&c.nat->regs.f[8], &uregs->f8);
+ COPY_FPREG(&c.nat->regs.f[9], &uregs->f9);
+ COPY_FPREG(&c.nat->regs.f[10], &uregs->f10);
+ COPY_FPREG(&c.nat->regs.f[11], &uregs->f11);
c.nat->regs.r[4] = uregs->r4;
c.nat->regs.r[5] = uregs->r5;
uregs->ar_ccv = c.nat->regs.ar.ccv;
- uregs->f6 = c.nat->regs.f[6];
- uregs->f7 = c.nat->regs.f[7];
- uregs->f8 = c.nat->regs.f[8];
- uregs->f9 = c.nat->regs.f[9];
- uregs->f10 = c.nat->regs.f[10];
- uregs->f11 = c.nat->regs.f[11];
+ COPY_FPREG(&uregs->f6, &c.nat->regs.f[6]);
+ COPY_FPREG(&uregs->f7, &c.nat->regs.f[7]);
+ COPY_FPREG(&uregs->f8, &c.nat->regs.f[8]);
+ COPY_FPREG(&uregs->f9, &c.nat->regs.f[9]);
+ COPY_FPREG(&uregs->f10, &c.nat->regs.f[10]);
+ COPY_FPREG(&uregs->f11, &c.nat->regs.f[11]);
uregs->r4 = c.nat->regs.r[4];
uregs->r5 = c.nat->regs.r[5];
#ifdef XEN
#include <xen/types.h>
#include <public/xen.h>
-#define pt_regs cpu_user_regs
-
-/* User regs at placed at the end of the vcpu area.
- Convert a vcpu pointer to a regs pointer.
- Note: this is the same as ia64_task_regs, but it uses a Xen-friendly name.
-*/
-struct vcpu;
-static inline struct cpu_user_regs *
-vcpu_regs (struct vcpu *v)
-{
- return (struct cpu_user_regs *) ((unsigned long) v + IA64_STK_OFFSET) - 1;
-}
-struct pt_regs *guest_cpu_user_regs(void);
+#define pt_regs cpu_user_regs
+#endif
-#else
struct pt_regs {
/* The following registers are saved by SAVE_MIN: */
unsigned long b6; /* scratch */
struct ia64_fpreg f9; /* scratch */
struct ia64_fpreg f10; /* scratch */
struct ia64_fpreg f11; /* scratch */
+#ifdef XEN
+ unsigned long r4; /* preserved */
+ unsigned long r5; /* preserved */
+ unsigned long r6; /* preserved */
+ unsigned long r7; /* preserved */
+ unsigned long eml_unat; /* used for emulating instruction */
+ unsigned long pad0; /* alignment pad */
+#endif
};
+
+#ifdef XEN
+/*
+ * User regs are placed at the end of the vcpu area.
+ * Convert a vcpu pointer to a regs pointer.
+ * Note: this is the same as ia64_task_regs, but it uses a Xen-friendly name.
+ */
+struct vcpu;
+static inline struct cpu_user_regs *vcpu_regs(struct vcpu *v)
+{
+ return (struct cpu_user_regs *)((unsigned long)v + IA64_STK_OFFSET) - 1;
+}
+
+struct cpu_user_regs *guest_cpu_user_regs(void);
#endif
/*
#include <linux/acpi.h>
struct vcpu;
typedef struct vcpu VCPU;
-typedef cpu_user_regs_t REGS;
+typedef struct cpu_user_regs REGS;
+
extern u64 cycle_to_ns(u64 cycle);
/* Note: PSCB stands for Privilegied State Communication Block. */
#define IA64_IFS_V_BIT 63
#define IA64_IFS_V (__IA64_UL(1) << IA64_IFS_V_BIT)
+/* Interruption Status Register. */
+#define IA64_ISR_NI_BIT 39 /* Nested interrupt. */
+
/* Page Table Address */
#define IA64_PTA_VE_BIT 0
#define IA64_PTA_SIZE_BIT 2
} u;
};
-struct cpu_user_regs {
- /* The following registers are saved by SAVE_MIN: */
- unsigned long b6; /* scratch */
- unsigned long b7; /* scratch */
-
- unsigned long ar_csd; /* used by cmp8xchg16 (scratch) */
- unsigned long ar_ssd; /* reserved for future use (scratch) */
-
- unsigned long r8; /* scratch (return value register 0) */
- unsigned long r9; /* scratch (return value register 1) */
- unsigned long r10; /* scratch (return value register 2) */
- unsigned long r11; /* scratch (return value register 3) */
-
- unsigned long cr_ipsr; /* interrupted task's psr */
- unsigned long cr_iip; /* interrupted task's instruction pointer */
- unsigned long cr_ifs; /* interrupted task's function state */
-
- unsigned long ar_unat; /* interrupted task's NaT register (preserved) */
- unsigned long ar_pfs; /* prev function state */
- unsigned long ar_rsc; /* RSE configuration */
- /* The following two are valid only if cr_ipsr.cpl > 0: */
- unsigned long ar_rnat; /* RSE NaT */
- unsigned long ar_bspstore; /* RSE bspstore */
-
- unsigned long pr; /* 64 predicate registers (1 bit each) */
- unsigned long b0; /* return pointer (bp) */
- unsigned long loadrs; /* size of dirty partition << 16 */
-
- unsigned long r1; /* the gp pointer */
- unsigned long r12; /* interrupted task's memory stack pointer */
- unsigned long r13; /* thread pointer */
-
- unsigned long ar_fpsr; /* floating point status (preserved) */
- unsigned long r15; /* scratch */
-
- /* The remaining registers are NOT saved for system calls. */
-
- unsigned long r14; /* scratch */
- unsigned long r2; /* scratch */
- unsigned long r3; /* scratch */
- unsigned long r16; /* scratch */
- unsigned long r17; /* scratch */
- unsigned long r18; /* scratch */
- unsigned long r19; /* scratch */
- unsigned long r20; /* scratch */
- unsigned long r21; /* scratch */
- unsigned long r22; /* scratch */
- unsigned long r23; /* scratch */
- unsigned long r24; /* scratch */
- unsigned long r25; /* scratch */
- unsigned long r26; /* scratch */
- unsigned long r27; /* scratch */
- unsigned long r28; /* scratch */
- unsigned long r29; /* scratch */
- unsigned long r30; /* scratch */
- unsigned long r31; /* scratch */
- unsigned long ar_ccv; /* compare/exchange value (scratch) */
-
- /*
- * Floating point registers that the kernel considers scratch:
- */
- struct pt_fpreg f6; /* scratch */
- struct pt_fpreg f7; /* scratch */
- struct pt_fpreg f8; /* scratch */
- struct pt_fpreg f9; /* scratch */
- struct pt_fpreg f10; /* scratch */
- struct pt_fpreg f11; /* scratch */
- unsigned long r4; /* preserved */
- unsigned long r5; /* preserved */
- unsigned long r6; /* preserved */
- unsigned long r7; /* preserved */
- unsigned long eml_unat; /* used for emulating instruction */
- unsigned long pad0; /* alignment pad */
-
-};
-typedef struct cpu_user_regs cpu_user_regs_t;
-
union vac {
unsigned long value;
struct {
start_info | 1104 1152 1152
trap_info | 8 16 -
pt_fpreg | - - 16
-cpu_user_regs | 68 200 496
+cpu_user_regs | 68 200 -
xen_ia64_boot_param | - - 96
ia64_tr_entry | - - 32
vcpu_tr_regs | - - 512